package com.ricky.base.enums;

public enum TaskCardEnum {

    /**
     * 调派单状态
     */
    NEW_CARD(0,"等待接收"),
    CALLING(1,"语音通知"),
    ACCEPT(2,"接受,待部门审批"),
    REUSE(3,"拒绝"),
    DEPT_APPROVESUCCESS(4,"部门审批成功"),
    DEPT_APPROVEFAIL(5,"部门审批失败"),
    STOP(6,"任务已停止"),
    FINISH(7,"任务完成"),

    TIMEOUT_REJECTION(8,"超时拒绝"),
    APPROVAL_TIMEOUT_FAILED(9,"审批超时失败");

    private int code;
    private String msg;

    TaskCardEnum(String msg) {
        this.msg = msg;
    }

    TaskCardEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static String getMsgByCode(String code){
        if (null != code){
            TaskCardEnum[] values = TaskCardEnum.values();
            for (TaskCardEnum item : values){
                if (Integer.toString(item.getCode()).equals(code)){
                    return item.getMsg();
                }
            }
        }
        return null;
    }
}
